//
//  JwAlerter.h
//  JwPack
//
//  Created by 陈警卫 on 2024-08-27.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface JwAlerter : NSObject

/// 系统弹出框
/// cancelTitle 传入(默认index = 0) 不传(index后推)
/// destructiveTitle 传入(默认index = 1) 不传(index后推)
/// otherTitles 传入(默认index累加)
+ (void)showAlertWithTitle:(nullable NSString *)title
                   message:(nullable NSString *)message
            preferredStyle:(UIAlertControllerStyle)preferredStyle
               cancelTitle:(nullable NSString *)cancelTitle
          destructiveTitle:(nullable NSString *)destructiveTitle
               otherTitles:(nullable NSArray<NSString *> *)otherTitles
                   handler:(void (^)(UIAlertAction *action, NSInteger index))handler;

+ (void)showAlertWithTitle:(nullable NSString *)title
                   message:(nullable NSString *)message
               otherTitles:(nullable NSArray<NSString *> *)otherTitles
                   handler:(void (^)(UIAlertAction *action, NSInteger index))handler;

+ (void)showSheetAlertWithTitle:(nullable NSString *)title
                        message:(nullable NSString *)message
                    cancelTitle:(nullable NSString *)cancelTitle
               destructiveTitle:(nullable NSString *)destructiveTitle
                    otherTitles:(nullable NSArray<NSString *> *)otherTitles
                        handler:(void (^)(UIAlertAction *action, NSInteger index))handler;

@end

NS_ASSUME_NONNULL_END
